colnames(Dessert)[2]="Sex" colnames(Dessert)[5]="Dessert.favourite.part.of.meal" colnames(Dessert)[6]="Frequency.eat.desserts" levels(Dessert$Frequency.eat.desserts) <- c("less.than.once.a.week", "for.special.occasions", "more.than.once.a.day", "once.a.week", "twice.or.four.times.a.week") colnames(Dessert)[7]="When" levels(Dessert$Dessert.after.starter.and.meal) <- c("never", "sometimes", "often", "always") colnames(Dessert)[9:14]=c("Dessert.at.home", "Dessert.on.the.go", "Dessert.at.restaurant", "Dessert.at.canteen", "Dessert.at.fastfood", "Dessert.at.friends.home") levels(Dessert$With.whom) <- c("alone", "family", "friends", "boyfriend/girlfriend") levels(Dessert$Purchase.place) <- c("home made", "supermarket", "specialized.stores") colnames(Dessert)[18]="Prefered.taste" colnames(Dessert)[19]="Prefered.aspect" colnames(Dessert)[20]="Dessert.bought" levels(Dessert$Dessert.bought) <- c("an assortment", "greedy", "the favourite", "unknown or exotic") colnames(Dessert)[21]="Choice criterion" colnames(Dessert)[22:26]=c("buy.dessert.in.refrigerated.section", "buy.dessert.in.frozen.food.section", "buy.dessert.in.biscuits.section", "buy.dessert.in.pastry.section", "buy.dessert.in.exotic.section") colnames(Dessert)[27]="Nutritional.information.matters" colnames(Dessert)[28:46]=c("Dessert.associated.to.pleasure", "Dessert.associated.to.greedy", "Dessert.associated.to.health", "Dessert.associated.to.tradition", "Dessert.associated.to.natural", "Dessert.associated.to.fat", "Dessert.associated.to.sweet", "Dessert.associated.to.conviviality", "Dessert.associated.to.party", "Dessert.associated.to.childhood", "Dessert.associated.to.discovery", "Dessert.associated.to.practical", "Dessert.associated.to.excess", "Dessert.associated.to.beauty", "Dessert.associated.to.freshness", "Dessert.associated.to.chocolate", "Dessert.associated.to.birthday", "Dessert.associated.to.calory", "Dessert.associated.to.fruits") colnames(Dessert)[47:48]=c("Budget.individual.dessert", "Budget.familial.dessert") levels(Dessert$Budget.individual.dessert) <- c("1E or less", "1E to 2E", "2E to 4E", "4E to 6E", "7E and more") levels(Dessert$Budget.familial.dessert) <- c("10E to 15E", "4E or less", "5E to 10E", "15E and more") Dessert$buy.dessert.in.biscuits.section <- as.factor(Dessert$buy.dessert.in.biscuits.section) Dessert$buy.dessert.in.exotic.section <- as.factor(Dessert$buy.dessert.in.exotic.section) Dessert$buy.dessert.in.frozen.food.section <- as.factor(Dessert$buy.dessert.in.frozen.food.section) Dessert$buy.dessert.in.pastry.section <- as.factor(Dessert$buy.dessert.in.pastry.section) Dessert$buy.dessert.in.refrigerated.section <- as.factor(Dessert$buy.dessert.in.refrigerated.section) Dessert$Dessert.after.starter.and.meal <- as.factor(Dessert$Dessert.after.starter.and.meal) Dessert$Dessert.associated.to.beauty <- as.factor(Dessert$Dessert.associated.to.beauty) Dessert$Dessert.associated.to.birthday <- as.factor(Dessert$Dessert.associated.to.birthday) Dessert$Dessert.associated.to.calory <- as.factor(Dessert$Dessert.associated.to.calory) Dessert$Dessert.associated.to.childhood <- as.factor(Dessert$Dessert.associated.to.childhood) Dessert$Dessert.associated.to.chocolate <- as.factor(Dessert$Dessert.associated.to.chocolate) Dessert$Dessert.associated.to.conviviality <- as.factor(Dessert$Dessert.associated.to.conviviality) Dessert$Dessert.associated.to.discovery <- as.factor(Dessert$Dessert.associated.to.discovery) Dessert$Dessert.associated.to.excess <- as.factor(Dessert$Dessert.associated.to.excess) Dessert$Dessert.associated.to.fat <- as.factor(Dessert$Dessert.associated.to.fat) Dessert$Dessert.associated.to.freshness <- as.factor(Dessert$Dessert.associated.to.freshness) Dessert$Dessert.associated.to.fruits <- as.factor(Dessert$Dessert.associated.to.fruits) Dessert$Dessert.associated.to.greedy <- as.factor(Dessert$Dessert.associated.to.greedy) Dessert$Dessert.associated.to.health <- as.factor(Dessert$Dessert.associated.to.health) Dessert$Dessert.associated.to.natural <- as.factor(Dessert$Dessert.associated.to.natural) Dessert$Dessert.associated.to.party <- as.factor(Dessert$Dessert.associated.to.party) Dessert$Dessert.associated.to.pleasure <- as.factor(Dessert$Dessert.associated.to.pleasure) Dessert$Dessert.associated.to.practical <- as.factor(Dessert$Dessert.associated.to.practical) Dessert$Dessert.associated.to.sweet <- as.factor(Dessert$Dessert.associated.to.sweet) Dessert$Dessert.associated.to.tradition <- as.factor(Dessert$Dessert.associated.to.tradition) Dessert$Dessert.at.canteen <- as.factor(Dessert$Dessert.at.canteen) Dessert$Dessert.at.fastfood <- as.factor(Dessert$Dessert.at.fastfood) Dessert$Dessert.at.friends.home <- as.factor(Dessert$Dessert.at.friends.home) Dessert$Dessert.at.home <- as.factor(Dessert$Dessert.at.home) Dessert$Dessert.at.restaurant <- as.factor(Dessert$Dessert.at.restaurant) Dessert$Dessert.on.the.go <- as.factor(Dessert$Dessert.on.the.go) library(FactoMineR) library(dynGraph) library(EnQuireR) summary(Dessert) #MCA Dessert.MCA<-Dessert[, c("Dessert.favourite.part.of.meal", "Frequency.eat.desserts", "When", "Dessert.after.starter.and.meal", "Dessert.at.home", "Dessert.on.the.go", "Dessert.at.restaurant", "Dessert.at.canteen", "Dessert.at.fastfood", "Dessert.at.friends.home", "With.whom", "Size", "Purchase.place", "Dessert.bought", "buy.dessert.in.refrigerated.section", "buy.dessert.in.frozen.food.section", "buy.dessert.in.biscuits.section", "buy.dessert.in.pastry.section", "buy.dessert.in.exotic.section", "Nutritional.information.matters", "Budget.individual.dessert", "Budget.familial.dessert", "Age.class", "Sex", "Marital.status", "SPC", "Dessert.associated.to.pleasure", "Dessert.associated.to.greedy", "Dessert.associated.to.health", "Dessert.associated.to.tradition", "Dessert.associated.to.natural", "Dessert.associated.to.fat", "Dessert.associated.to.sweet", "Dessert.associated.to.conviviality", "Dessert.associated.to.party", "Dessert.associated.to.childhood", "Dessert.associated.to.discovery", "Dessert.associated.to.practical", "Dessert.associated.to.excess", "Dessert.associated.to.beauty", "Dessert.associated.to.freshness", "Dessert.associated.to.chocolate", "Dessert.associated.to.birthday", "Dessert.associated.to.calory", "Dessert.associated.to.fruits")] res<-MCA(Dessert.MCA, ncp=5, quali.sup=23:45, graph = FALSE) plot.MCA(res, axes=c(1, 2), col.ind="black", col.ind.sup="blue", col.var="darkred", col.quali.sup="darkgreen", label=c("ind", "ind.sup", "quali.sup", "var"), invisible=c("")) plot.MCA(res, axes=c(1, 2), choix="var", col.var="darkred", col.quali.sup="darkgreen", label=c("var", "quali.sup"), invisible=c("")) plot.MCA(res, invisible=c("var","ind")) plot.MCA(res, invisible=c("quali.sup","ind")) plot.MCA(res, invisible=c("quali.sup","var")) #Dimensions description dimdesc(res, axes = 1:2) #Clustering hcpc.res<-HCPC(res) hcpc.res$desc.var #dynGraph dynGraph(res) #EnQuireR (all the variables are active since there are missing data and the algorithm #for missing data does not work with supplementary elements yet) res.enmca = ENMCA(Dessert.MCA, report=TRUE)